import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import qs from 'qs';
import './permission'

Vue.prototype.$qs = qs
Vue.use(ViewUI);
Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// router.beforeEach(async (to,from,next) =>{
//   const token = '123';
//   console.log("path "+to.path)
//   if(token){
//     console.log("有token")
//     if (to.path === '/DashBoard'){
//       store.dispatch('getUserInfo').then(res =>{
//         console.log(res)
//       }).catch(error =>{
//         console.log(error)
//       })
//     }else {
//       const roles = store.getters.roles && store.getters.roles.length > 0
//       if(roles){
//         next();
//       }
//     }
//   }
//   else {
//     console.log("无token")
//
//   }
// })